package com.caishi.lkx.user.mapper.re;

import com.caishi.lkx.user.model.PositionModel;
import com.caishi.lkx.user.model.re.UserPositionReModel;
import com.zzw.common.entity.IBaseMapper;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDateTime;
import java.util.List;

/**
 * @author by keray
 * date:2021/4/20 4:09 下午
 */
public interface UserPositionReMapper extends IBaseMapper<UserPositionReModel, Long> {

    @Select("select * from cu_position where parent_id in (select position_id from cu_user_position_re where user_id = #{userId} and expire_time >= #{time})")
    List<PositionModel> userNextPositions(@Param("userId") String userId, @Param("time") LocalDateTime expireTime);
}
